package cn.com.fuhuitong.main.home.adapter

import android.content.Context
import android.view.View
import cn.com.fuhuitong.R
import cn.com.fuhuitong.base.BaseDelegateAdapter
import cn.com.fuhuitong.main.ItemViewType
import cn.com.fuhuitong.main.home.entity.BulletinListEntity
import com.alibaba.android.vlayout.LayoutHelper
import com.blankj.utilcode.util.TimeUtils
import kotlinx.android.synthetic.main.item_bulletin_list.view.*

class BulletinListAdapter(
    private val mContext: Context, private val mHelper: LayoutHelper
) : BaseDelegateAdapter<BulletinListEntity>(
    mContext = mContext,
    mHelper = mHelper,
    mLayoutId = R.layout.item_bulletin_list,
    mItemViewType = ItemViewType.BULLETIN_LIST
) {
    override fun onBindViewHolder(itemView: View, position: Int, itemData: BulletinListEntity) {
        super.onBindViewHolder(itemView, position, itemData)
        itemView.text_bulletin_list_title.text =
            itemData.title
        itemView.text_bulletin_list_time.text =
            TimeUtils.millis2String((itemData.createtime * 1000))
    }
}